package com.yiba.vpn.core;

import com.yiba.vpn.utils.CommonMethods;

/**
 * 封装了一个sessison
 * 远程ip 端口 域名 发送字节 发送的包的个数 时间戳
 */
public class NatSession {
    public int RemoteIP;
    public short RemotePort;
    public String RemoteHost;
    public int BytesSent;
    public int PacketSent;
    public long LastNanoTime;
    public boolean IsHttpsSession;
    public String RequestUrl; //HTTP请求的url， HTTPS请求则为空
    public String Method; //HTTP请求方法

    @Override
    public String toString() {
        return String.format("%s/%s:%d packet: %d", RemoteHost, CommonMethods.ipIntToString(RemoteIP),
                RemotePort & 0xFFFF, PacketSent);
    }
}
